package com.baichang.taoshunda.controller.mobile;

import com.baichang.framework.controller.BaseMobileController;
import com.baichang.framework.controller.IService;
import com.baichang.framework.excelption.ServiceException;
import com.baichang.taoshunda.controller.ControllerConstants;
import com.baichang.taoshunda.service.ReminderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by ${wushenglu} on 17/08/25.
 */
@Controller
@RequestMapping(ControllerConstants.Reminder)
public class ReminderMCtronller extends BaseMobileController {
    @Autowired
    private ReminderService reminderService;

    /**
     * 催单
     *
     * @param request
     * @param response
     */
    @RequestMapping("/reminderOrder")
    public void reminderOrder(HttpServletRequest request, HttpServletResponse response) {
        initEncode(request, response, new IService() {
            @Override
            public Object init(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, String json) throws ServiceException {
                Integer userId = getInteger(json, "userId", 0);
                Integer orderId = getInteger(json, "orderId", 0);
                Integer deliveryId = getInteger(json, "deliveryId", 0);
                Integer bussId = getInteger(json, "bussId", 0);
                return reminderService.reminderOrder(userId, orderId, deliveryId,bussId);
            }
        });
    }
}
